#include "cdownloadmatches.h"
#include <QUrl>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QDebug>

CDownloadMatches::CDownloadMatches(QObject *parent) :
    QObject(parent)
{
    m_manager = new QNetworkAccessManager(this);

    connect(m_manager, SIGNAL(finished(QNetworkReply*)),
         this, SLOT(replyFinished(QNetworkReply*)));
}

void CDownloadMatches::fetch()
{
    m_manager->get(QNetworkRequest(QUrl("http://www.flashscore.ro/iframe/sport.php")));
}

void CDownloadMatches::replyFinished(QNetworkReply* pReply)
{

    QByteArray data=pReply->readAll();
    QString str(data);
    qDebug() << str;

    //process str any way you like!

}

